<?php

/**
 * AcctSet form base class.
 *
 * @method AcctSet getObject() Returns the current form's model object
 *
 * @package    tinystockmis
 * @subpackage form
 * @author     Linfeng Wu
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseAcctSetForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'set_name'         => new sfWidgetFormInputText(),
      'create_date'      => new sfWidgetFormDate(),
      'set_start_year'   => new sfWidgetFormInputText(),
      'set_start_mon'    => new sfWidgetFormInputText(),
      'set_current_year' => new sfWidgetFormInputText(),
      'set_current_mon'  => new sfWidgetFormInputText(),
      'opr'              => new sfWidgetFormInputText(),
      'acct_type_id'     => new sfWidgetFormInputText(),
      'fin_manager'      => new sfWidgetFormInputText(),
      'company_name'     => new sfWidgetFormInputText(),
      'is_activated'     => new sfWidgetFormInputText(),
      'created_at'       => new sfWidgetFormDateTime(),
      'updated_at'       => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'               => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'set_name'         => new sfValidatorString(array('max_length' => 45)),
      'create_date'      => new sfValidatorDate(),
      'set_start_year'   => new sfValidatorInteger(),
      'set_start_mon'    => new sfValidatorInteger(array('required' => false)),
      'set_current_year' => new sfValidatorInteger(),
      'set_current_mon'  => new sfValidatorInteger(array('required' => false)),
      'opr'              => new sfValidatorString(array('max_length' => 45)),
      'acct_type_id'     => new sfValidatorInteger(),
      'fin_manager'      => new sfValidatorString(array('max_length' => 45)),
      'company_name'     => new sfValidatorString(array('max_length' => 200)),
      'is_activated'     => new sfValidatorInteger(array('required' => false)),
      'created_at'       => new sfValidatorDateTime(),
      'updated_at'       => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('acct_set[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'AcctSet';
  }

}
